3.89 \(\int \frac{x (A+B x+C x^2+D x^3)}{a+b x^2} \, dx\)

Optimal. Leaf size=92 \[ \frac{(A b-a C) \log \left (a+b x^2\right )}{2 b^2}+\frac{x (b B-a D)}{b^2}-\frac{\sqrt{a} (b B-a D) \tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right )}{b^{5/2}}+\frac{C x^2}{2 b}+\frac{D x^3}{3 b} \]

[Out]

((b*B - a*D)*x)/b^2 + (C*x^2)/(2*b) + (D*x^3)/(3*b) - (Sqrt[a]*(b*B - a*D)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(5/2
) + ((A*b - a*C)*Log[a + b*x^2])/(2*b^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0846149, antiderivative size = 92, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {1802, 635, 205, 260} \[ \frac{(A b-a C) \log \left (a+b x^2\right )}{2 b^2}+\frac{x (b B-a D)}{b^2}-\frac{\sqrt{a} (b B-a D) \tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right )}{b^{5/2}}+\frac{C x^2}{2 b}+\frac{D x^3}{3 b} \]

Antiderivative was successfully verified.

[In]

Int[(x*(A + B*x + C*x^2 + D*x^3))/(a + b*x^2),x]

[Out]

((b*B - a*D)*x)/b^2 + (C*x^2)/(2*b) + (D*x^3)/(3*b) - (Sqrt[a]*(b*B - a*D)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(5/2
) + ((A*b - a*C)*Log[a + b*x^2])/(2*b^2)

Rule 1802

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*Pq*(a + b*x
^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

\begin{align*} \int \frac{x \left (A+B x+C x^2+D x^3\right )}{a+b x^2} \, dx &=\int \left (\frac{b B-a D}{b^2}+\frac{C x}{b}+\frac{D x^2}{b}-\frac{a (b B-a D)-b (A b-a C) x}{b^2 \left (a+b x^2\right )}\right ) \, dx\\ &=\frac{(b B-a D) x}{b^2}+\frac{C x^2}{2 b}+\frac{D x^3}{3 b}-\frac{\int \frac{a (b B-a D)-b (A b-a C) x}{a+b x^2} \, dx}{b^2}\\ &=\frac{(b B-a D) x}{b^2}+\frac{C x^2}{2 b}+\frac{D x^3}{3 b}+\frac{(A b-a C) \int \frac{x}{a+b x^2} \, dx}{b}-\frac{(a (b B-a D)) \int \frac{1}{a+b x^2} \, dx}{b^2}\\ &=\frac{(b B-a D) x}{b^2}+\frac{C x^2}{2 b}+\frac{D x^3}{3 b}-\frac{\sqrt{a} (b B-a D) \tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right )}{b^{5/2}}+\frac{(A b-a C) \log \left (a+b x^2\right )}{2 b^2}\\ \end{align*}

Mathematica [A]  time = 0.0637263, size = 81, normalized size = 0.88 \[ \frac{3 (A b-a C) \log \left (a+b x^2\right )+x (-6 a D+6 b B+b x (3 C+2 D x))}{6 b^2}+\frac{\sqrt{a} (a D-b B) \tan ^{-1}\left (\frac{\sqrt{b} x}{\sqrt{a}}\right )}{b^{5/2}} \]

Antiderivative was successfully verified.

[In]

Integrate[(x*(A + B*x + C*x^2 + D*x^3))/(a + b*x^2),x]

[Out]

(Sqrt[a]*(-(b*B) + a*D)*ArcTan[(Sqrt[b]*x)/Sqrt[a]])/b^(5/2) + (x*(6*b*B - 6*a*D + b*x*(3*C + 2*D*x)) + 3*(A*b
 - a*C)*Log[a + b*x^2])/(6*b^2)

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 106, normalized size = 1.2 \begin{align*}{\frac{D{x}^{3}}{3\,b}}+{\frac{C{x}^{2}}{2\,b}}+{\frac{Bx}{b}}-{\frac{aDx}{{b}^{2}}}+{\frac{\ln \left ( b{x}^{2}+a \right ) A}{2\,b}}-{\frac{\ln \left ( b{x}^{2}+a \right ) aC}{2\,{b}^{2}}}-{\frac{Ba}{b}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}}+{\frac{{a}^{2}D}{{b}^{2}}\arctan \left ({bx{\frac{1}{\sqrt{ab}}}} \right ){\frac{1}{\sqrt{ab}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(D*x^3+C*x^2+B*x+A)/(b*x^2+a),x)

[Out]

1/3*D*x^3/b+1/2*C*x^2/b+1/b*B*x-1/b^2*a*D*x+1/2/b*ln(b*x^2+a)*A-1/2/b^2*ln(b*x^2+a)*a*C-1/b/(a*b)^(1/2)*arctan
(b*x/(a*b)^(1/2))*B*a+1/b^2/(a*b)^(1/2)*arctan(b*x/(a*b)^(1/2))*a^2*D

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(D*x^3+C*x^2+B*x+A)/(b*x^2+a),x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: UnboundLocalError} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(D*x^3+C*x^2+B*x+A)/(b*x^2+a),x, algorithm="fricas")

[Out]

Exception raised: UnboundLocalError

________________________________________________________________________________________

Sympy [B]  time = 0.968387, size = 211, normalized size = 2.29 \begin{align*} \frac{C x^{2}}{2 b} + \frac{D x^{3}}{3 b} + \left (- \frac{- A b + C a}{2 b^{2}} - \frac{\sqrt{- a b^{5}} \left (- B b + D a\right )}{2 b^{5}}\right ) \log{\left (x + \frac{- A b + C a + 2 b^{2} \left (- \frac{- A b + C a}{2 b^{2}} - \frac{\sqrt{- a b^{5}} \left (- B b + D a\right )}{2 b^{5}}\right )}{- B b + D a} \right )} + \left (- \frac{- A b + C a}{2 b^{2}} + \frac{\sqrt{- a b^{5}} \left (- B b + D a\right )}{2 b^{5}}\right ) \log{\left (x + \frac{- A b + C a + 2 b^{2} \left (- \frac{- A b + C a}{2 b^{2}} + \frac{\sqrt{- a b^{5}} \left (- B b + D a\right )}{2 b^{5}}\right )}{- B b + D a} \right )} - \frac{x \left (- B b + D a\right )}{b^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(D*x**3+C*x**2+B*x+A)/(b*x**2+a),x)

[Out]

C*x**2/(2*b) + D*x**3/(3*b) + (-(-A*b + C*a)/(2*b**2) - sqrt(-a*b**5)*(-B*b + D*a)/(2*b**5))*log(x + (-A*b + C
*a + 2*b**2*(-(-A*b + C*a)/(2*b**2) - sqrt(-a*b**5)*(-B*b + D*a)/(2*b**5)))/(-B*b + D*a)) + (-(-A*b + C*a)/(2*
b**2) + sqrt(-a*b**5)*(-B*b + D*a)/(2*b**5))*log(x + (-A*b + C*a + 2*b**2*(-(-A*b + C*a)/(2*b**2) + sqrt(-a*b*
*5)*(-B*b + D*a)/(2*b**5)))/(-B*b + D*a)) - x*(-B*b + D*a)/b**2

________________________________________________________________________________________

Giac [A]  time = 1.18793, size = 119, normalized size = 1.29 \begin{align*} -\frac{{\left (C a - A b\right )} \log \left (b x^{2} + a\right )}{2 \, b^{2}} + \frac{{\left (D a^{2} - B a b\right )} \arctan \left (\frac{b x}{\sqrt{a b}}\right )}{\sqrt{a b} b^{2}} + \frac{2 \, D b^{2} x^{3} + 3 \, C b^{2} x^{2} - 6 \, D a b x + 6 \, B b^{2} x}{6 \, b^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(D*x^3+C*x^2+B*x+A)/(b*x^2+a),x, algorithm="giac")

[Out]

-1/2*(C*a - A*b)*log(b*x^2 + a)/b^2 + (D*a^2 - B*a*b)*arctan(b*x/sqrt(a*b))/(sqrt(a*b)*b^2) + 1/6*(2*D*b^2*x^3
 + 3*C*b^2*x^2 - 6*D*a*b*x + 6*B*b^2*x)/b^3